import { access } from 'fs/promises'
import type { PathLike } from 'fs'

export async function existsAsync (path: PathLike, mode?: number) {
  try {
    await access(path, mode)
    return true
  } catch {
    return false
  }
}
